package com.chixing.day17.MoreThread;

public class Consumer implements Runnable{
    //消费者
    private Storage storage;

    public Consumer() {
    }

    public Consumer(Storage storage) {
        this.storage = storage;
    }

    @Override
    public void run() {
        while(true){
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            storage.consume();
        }
    }
}
